package com.ivanceras.shared.db;

import com.ivanceras.shared.exception.DatabaseException;


public interface IDatabaseAsync extends IDatabase{

	void beginTransaction(AsyncDBCallback<Void> callback);

	void commitTransaction(AsyncDBCallback<Void> callback);

	void rollbackTransaction(AsyncDBCallback<Void> callback);

	void isTransacted(AsyncDBCallback<Boolean> callback);

	void createModel(IModelDef model, AsyncDBCallback<Boolean> callback);

	void delete(IModelDef model, Filter[] filters,
			AsyncDBCallback<Integer> callback);

	void drop(IModelDef model, AsyncDBCallback<Boolean> callback);

	void empty(IModelDef model, AsyncDBCallback<Integer> callback);

	void getModelMetaData(String tableName, AsyncDBCallback<IModelDef> callback);

	void getTableNames(String schema, String tablePattern,
			AsyncDBCallback<String[]> callback);

	void getTotalRecords(String schema, String modelName,
			AsyncDBCallback<Integer> callback);

	void insert(DAO dao, IModelDef model, AsyncDBCallback<DAO> callback);

	void isClosed(AsyncDBCallback<Boolean> callback);

	void reset(AsyncDBCallback<Boolean> callback);

	void select(IModelDef model, Join join, Filter[] filters, Integer offset,
			Integer limit, Boolean doCount, Order[] orders,
			AsyncDBCallback<DAO[]> callback) throws DatabaseException;

	void selectOne(IModelDef model, Join join, Filter[] filters,
	Integer offset, Integer limit, Boolean doCount, Order[] orders,
	AsyncDBCallback<DAO> callback) throws DatabaseException;

	void update(DAO dao, IModelDef model, Filter[] filters,
			AsyncDBCallback<DAO> callback) throws DatabaseException;

}
